#!/usr/bin/env python
# -*-conding:utf-8-*-

import js2py # 执行js代码
import jsbeautifier # 将混淆加密过的js代码解密
import requests  # 发送http请求
from bs4 import BeautifulSoup  # 解析html

js2py.eval_js('var a="hello"; console.info(a);')
add = js2py.eval_js('function fun(a, b){return a + b}')
print(add(2, 3))

js_str = r'''var g_search_data = [{"id":"9949","name":"\u4e00\u62f3\u8d85\u4eba","alias_name":"\u4e00\u51fb\u7537,one punch man,\u79c3\u5934\u62ab\u98ce\u4fa0","real_name":"","publish":null,"type":null,"zone":"\u65e5\u672c","zone_tag_id":"2304","language":"\u4e2d\u6587","status":"","status_tag_id":"2309","last_update_chapter_name":"\u7b2c146\u8bdd","last_update_chapter_id":"82322","last_updatetime":"1551093651","check":"0","chapters_tbl":"comics_chapter_4","description":"\u4e3b\u4eba\u516c\u57fc\u7389\u539f\u672c\u662f\u4e00\u540d\u6574\u65e5\u5954\u6ce2\u4e8e\u6c42\u804c\u7684\u666e\u901a\u4eba\u30023\u5e74\u524d\u7684\u4e00\u5929\u5076\u7136\u9047\u5230\u4e86\u8981\u5bf9\u6dd8\u6c14\u5c11\u5e74\u4e0b\u6740\u624b\u7684\u5f02\u53d8\u8783\u87f9\u4eba\u540e\uff0c\u56de\u5fc6\u8d77\u5e74\u5c11\u5e74\u65f6\u201c\u60f3\u8981\u6210\u4e3a\u82f1\u96c4\u201d\u7684\u68a6\u60f3\uff0c\u6700\u7ec8\u62fc\u5c3d\u5168\u529b\u6551\u4e0b\u4e86\u6dd8\u6c14\u5c11\u5e74\u3002\u4e4b\u540e\u901a\u8fc7\u62fc\u547d\u953b\u70bc\uff0c\u57fc\u7389\u7ec8\u4e8e\u8131\u80ce\u6362\u9aa8\u83b7\u5f97\u4e86\u6700\u5f3a\u7684\u529b\u91cf\uff0c\u4f46\u540c\u65f6\u5931\u53bb\u4e86\u5934\u53d1\u6210\u4e86\u5149\u5934\u3002\u5728\u72ec\u81ea\u505a\u4e86\u4e00\u6bb5\u65f6\u95f4\u82f1\u96c4\u540e\uff0c\u6b63\u5f0f\u52a0\u5165\u82f1\u96c4\u534f\u4f1a\uff0c\u4e0e\u4f17\u591a\u82f1\u96c4\u4e00\u8d77\u5f00\u59cb\u4e86\u5bf9\u6297\u5404\u79cd\u602a\u4eba\u4ee5\u53ca\u6076\u52bf\u529b\u7684\u751f\u6d3b\u2026\u2026","hidden":"0","cover":"\/\/images.dmzj.com\/webpic\/1\/onepunchmanfengmianl.jpg","sum_chapters":"381","sum_source":"8585","hot_search":"1","hot_hits":"92103988","first_letter":"y","keywords":"","comic_py":"yiquanchaoren","introduction":"\u4e3b\u4eba\u516c\u57fc\u7389\u539f\u672c\u662f\u4e00\u540d\u6574\u65e5\u5954\u6ce2\u4e8e\u6c42\u804c\u7684\u666e\u901a\u4eba\u30023\u5e74\u524d\u7684\u4e00\u5929\u5076\u7136\u9047\u5230\u4e86\u8981\u5bf9\u6dd8\u6c14\u5c11\u5e74\u4e0b\u6740\u624b\u7684\u5f02\u53d8\u8783\u87f9\u4eba\u540e\uff0c\u56de\u5fc6\u8d77\u5e74\u5c11\u5e74\u65f6\u201c\u60f3\u8981\u6210\u4e3a\u82f1\u96c4\u201d\u7684\u68a6\u60f3\uff0c\u6700\u7ec8\u62fc\u5c3d\u5168\u529b\u6551\u4e0b\u4e86\u6dd8\u6c14\u5c11\u5e74\u3002\u4e4b\u540e\u901a\u8fc7\u62fc\u547d\u953b\u70bc\uff0c\u57fc\u7389\u7ec8\u4e8e\u8131\u80ce\u6362\u9aa8\u83b7\u5f97\u4e86\u6700\u5f3a\u7684\u529b\u91cf\uff0c\u4f46\u540c\u65f6\u5931\u53bb\u4e86\u5934\u53d1\u6210\u4e86\u5149\u5934\u3002\u5728\u72ec\u81ea\u505a\u4e86\u4e00\u6bb5\u65f6\u95f4\u82f1\u96c4\u540e\uff0c\u6b63\u5f0f\u52a0\u5165\u82f1\u96c4\u534f\u4f1a\uff0c\u4e0e\u4f17\u591a\u82f1\u96c4\u4e00\u8d77\u5f00\u59cb\u4e86\u5bf9\u6297\u5404\u79cd\u602a\u4eba\u4ee5\u53ca\u6076\u52bf\u529b\u7684\u751f\u6d3b\u2026\u2026<br>\u52a8\u753b\u5b98\u7f51\u5730\u5740\uff1a<a href=\"http:\/\/onepunchman-anime.net\/\">http:\/\/onepunchman-anime.net\/<\/a>\n","addtime":null,"authors":"\u6751\u7530\u96c4\u4ecb\/ONE","types":"\u5192\u9669\/\u6b22\u4e50\u5411\/\u683c\u6597","series":"","need_update":"0","update_notice":"","readergroup":"\u5c11\u5e74\u6f2b\u753b","readergroup_tag_id":"3262","has_comment_id":"1","comment_key":"","day_click_count":"107495","week_click_count":"588523","month_click_count":"3946429","page_show_flag":"0","token":"M5EBxt","source":"\u8f6c\u8f7d","grade":"0","copyright":"0","direction":"1","token32":"9e351053365c7c6b07a33149adef3bf6","url":"","mobile":"1","w_link":"2","app_day_click_count":"183","app_week_click_count":"1676","app_month_click_count":"13609","app_click_count":"15578503","islong":"2","alading":"1","uid":null,"week_add_num":"1","month_add_num":"1","total_add_num":"0","sogou":"2","baidu_assistant":"0","is_checked":"1","quality":"1","is_show_animation_list":"0","zone_link":"","is_dmzj":"0","device_show":"7","myfcomic_comic_id":"0","comic_name":"\u4e00\u62f3\u8d85\u4eba","comic_author":"\u6751\u7530\u96c4\u4ecb\/ONE","comic_cover":"\/\/images.dmzj.com\/webpic\/1\/onepunchmanfengmianl.jpg","comic_url_raw":"\/\/manhua.dmzj.com\/yiquanchaoren","comic_url":"\/\/manhua.dmzj.com\/yiquanchaoren","chapter_url_raw":"\/\/manhua.dmzj.com\/yiquanchaoren\/82322.shtml","chapter_url":"\/\/manhua.dmzj.com\/..\/yiquanchaoren\/82322.shtml"},{"id":"27460","name":"\u57fc\u7389\u8001\u5e08\u5973\u2640\u4f53\u5316\u540c\u4eba","alias_name":"\u4e00\u62f3\u8d85\u4eba\u540c\u4eba,\u4e00\u51fb\u7537\u540c\u4eba","real_name":"","publish":null,"type":null,"zone":"\u65e5\u672c","zone_tag_id":"2304","language":"\u4e2d\u6587","status":"[<span class=\"red1_font12\">\u5b8c<\/span>]","status_tag_id":"2310","last_update_chapter_name":"\u7d22\u2640\u5c3c\u514b","last_update_chapter_id":"50896","last_updatetime":"1456390091","check":"0","chapters_tbl":"comics_chapter_0","description":"\u5f53\u57fc\u7389\u8001\u5e08\u4e00\u89c9\u9192\u6765\u53d1\u73b0\u591a\u4e862\u4e2a\u6b27\u6d3e\u4e4b\u540e\u2026\u2026","hidden":"0","cover":"\/\/images.dmzj.com\/webpic\/13\/yqcrnth68l.jpg","sum_chapters":"4","sum_source":"35","hot_search":"1","hot_hits":"44885","first_letter":"q","keywords":"","comic_py":"qiyulaoshinvtihuatongren","introduction":"\u5f53\u57fc\u7389\u8001\u5e08\u4e00\u89c9\u9192\u6765\u53d1\u73b0\u591a\u4e862\u4e2a\u6b27\u6d3e\u4e4b\u540e\u2026\u2026","addtime":null,"authors":"\u4f5a\u540d","types":"\u6027\u8f6c\u6362\/\u6b22\u4e50\u5411","series":"","need_update":"0","update_notice":"","readergroup":"\u5c11\u5e74\u6f2b\u753b","readergroup_tag_id":"3262","has_comment_id":"1","comment_key":"","day_click_count":"108","week_click_count":"611","month_click_count":"3630","page_show_flag":"0","token":"JtwBFl","source":"\u8f6c\u8f7d","grade":"0","copyright":"0","direction":"1","token32":"a4b8c367042642e1cea0b85c7e3a0b30","url":"","mobile":"1","w_link":"2","app_day_click_count":"5","app_week_click_count":"26","app_month_click_count":"131","app_click_count":"1071","islong":"2","alading":"2","uid":null,"week_add_num":"1","month_add_num":"1","total_add_num":"0","sogou":"2","baidu_assistant":"0","is_checked":"0","quality":"1","is_show_animation_list":"0","zone_link":"","is_dmzj":"0","device_show":"7","myfcomic_comic_id":"0","comic_name":"\u57fc\u7389\u8001\u5e08\u5973\u2640\u4f53\u5316\u540c\u4eba","comic_author":"\u4f5a\u540d","comic_cover":"\/\/images.dmzj.com\/webpic\/13\/yqcrnth68l.jpg","comic_url_raw":"\/\/manhua.dmzj.com\/qiyulaoshinvtihuatongren","comic_url":"\/\/manhua.dmzj.com\/qiyulaoshinvtihuatongren","chapter_url_raw":"\/\/manhua.dmzj.com\/qiyulaoshinvtihuatongren\/50896.shtml","chapter_url":"\/\/manhua.dmzj.com\/..\/qiyulaoshinvtihuatongren\/50896.shtml"},{"id":"27560","name":"\u4e00\u62f3\u8d85\u4eba \u732b\u8033","alias_name":"","real_name":"","publish":null,"type":null,"zone":"\u65e5\u672c","zone_tag_id":"2304","language":"\u4e2d\u6587","status":"[<span class=\"red1_font12\">\u5b8c<\/span>]","status_tag_id":"2310","last_update_chapter_name":"\u77ed\u7bc7","last_update_chapter_id":"49485","last_updatetime":"1452237315","check":"0","chapters_tbl":"comics_chapter_0","description":"\u4e00\u62f3\u8d85\u4eba\u7684\u6076\u641e\u540c\u4eba\u3002","hidden":"1","cover":"\/\/images.dmzj.com\/webpic\/13\/yiquanchaorenmaoer.jpg","sum_chapters":"1","sum_source":"7","hot_search":"1","hot_hits":"6611","first_letter":"y","keywords":"","comic_py":"yiquanchaorenmaoer","introduction":"\u4e00\u62f3\u8d85\u4eba\u7684\u6076\u641e\u540c\u4eba\u3002","addtime":null,"authors":"\u4f5a\u540d","types":"\u6b22\u4e50\u5411","series":"","need_update":"0","update_notice":"","readergroup":"\u5c11\u5e74\u6f2b\u753b","readergroup_tag_id":"3262","has_comment_id":"1","comment_key":"","day_click_count":"17","week_click_count":"51","month_click_count":"240","page_show_flag":"0","token":"poo8ck","source":"\u8f6c\u8f7d","grade":"0","copyright":"0","direction":"1","token32":"b513342e961ba7a4bee11bf48c997acc","url":"","mobile":"1","w_link":"2","app_day_click_count":"1","app_week_click_count":"7","app_month_click_count":"18","app_click_count":"93","islong":"2","alading":"2","uid":null,"week_add_num":"1","month_add_num":"1","total_add_num":"0","sogou":"2","baidu_assistant":"0","is_checked":"0","quality":"1","is_show_animation_list":"0","zone_link":"","is_dmzj":"0","device_show":"3","myfcomic_comic_id":"0","comic_name":"\u4e00\u62f3\u8d85\u4eba \u732b\u8033","comic_author":"\u4f5a\u540d","comic_cover":"\/\/images.dmzj.com\/webpic\/13\/yiquanchaorenmaoer.jpg","comic_url_raw":"\/\/manhua.dmzj.com\/yiquanchaorenmaoer","comic_url":"\/\/manhua.dmzj.com\/yiquanchaorenmaoer","chapter_url_raw":"\/\/manhua.dmzj.com\/yiquanchaorenmaoer","chapter_url":"\/\/manhua.dmzj.com\/yiquanchaorenmaoer"},{"id":"31873","name":"\u4e00\u62f3\u8d85\u4eba\u82f1\u96c4\u5927\u5168","alias_name":"","real_name":"","publish":null,"type":null,"zone":"\u65e5\u672c","zone_tag_id":"2304","language":"\u4e2d\u6587","status":"[<span class=\"red1_font12\">\u5b8c<\/span>]","status_tag_id":"2310","last_update_chapter_name":"\u5168\u4e00\u5377","last_update_chapter_id":"47845","last_updatetime":"1459760224","check":"0","chapters_tbl":"comics_chapter_3","description":"ONE\u8001\u5e08\u4eb2\u81ea\u76d1\u4fee\uff01\u82f1\u96c4\u4eec\u7684\u6781\u79d8\u8d44\u6599\uff01","hidden":"1","cover":"\/\/images.dmzj.com\/webpic\/7\/yiquanchaorenyingxiongdaquan.jpg","sum_chapters":"1","sum_source":"129","hot_search":"1","hot_hits":"1","first_letter":"y","keywords":"","comic_py":"yiquanchaorenyingxiongdaquan","introduction":"ONE\u8001\u5e08\u4eb2\u81ea\u76d1\u4fee\uff01\u82f1\u96c4\u4eec\u7684\u6781\u79d8\u8d44\u6599\uff01","addtime":null,"authors":"ONE\/\u6751\u7530\u96c4\u4ecb","types":"\u5176\u4ed6","series":"","need_update":"0","update_notice":"","readergroup":"\u5c11\u5e74\u6f2b\u753b","readergroup_tag_id":"3262","has_comment_id":"1","comment_key":"","day_click_count":"0","week_click_count":"0","month_click_count":"0","page_show_flag":"0","token":"YJdsMt","source":"\u8f6c\u8f7d","grade":"0","copyright":"0","direction":"1","token32":"2b578ee228b3a686606e7d4fc0f4c155","url":"","mobile":"1","w_link":"2","app_day_click_count":"1","app_week_click_count":"1","app_month_click_count":"1","app_click_count":"1","islong":"2","alading":"2","uid":null,"week_add_num":"0","month_add_num":"0","total_add_num":"0","sogou":"2","baidu_assistant":"0","is_checked":"0","quality":"1","is_show_animation_list":"0","zone_link":"","is_dmzj":"0","device_show":"3","myfcomic_comic_id":"0","comic_name":"\u4e00\u62f3\u8d85\u4eba\u82f1\u96c4\u5927\u5168","comic_author":"ONE\/\u6751\u7530\u96c4\u4ecb","comic_cover":"\/\/images.dmzj.com\/webpic\/7\/yiquanchaorenyingxiongdaquan.jpg","comic_url_raw":"\/\/manhua.dmzj.com\/yiquanchaorenyingxiongdaquan","comic_url":"\/\/manhua.dmzj.com\/yiquanchaorenyingxiongdaquan","chapter_url_raw":"\/\/manhua.dmzj.com\/yiquanchaorenyingxiongdaquan","chapter_url":"\/\/manhua.dmzj.com\/yiquanchaorenyingxiongdaquan"},{"id":"38883","name":"\u4e00\u62f3\u5deb\u5973","alias_name":"\u4e00\u62f3\u8d85\u4eba\u540c\u4eba,\u4e00\u51fb\u7537\u540c\u4eba,\u30ef\u30f3\u30d1\u30f3\u30df\u30b3","real_name":"","publish":null,"type":null,"zone":"\u65e5\u672c","zone_tag_id":"2304","language":"\u4e2d\u6587","status":"[<span class=\"red1_font12\">\u5b8c<\/span>]","status_tag_id":"2310","last_update_chapter_name":"\u5168\u4e00\u8bdd","last_update_chapter_id":"53795","last_updatetime":"1475135900","check":"0","chapters_tbl":"comics_chapter_3","description":"\u4ee5\u4e00\u62f3\u8d85\u4eba\u4eba\u8bbe\u66ff\u6362\u4e1c\u65b9\u4e16\u754c\u4eba\u8bbe\u7684\u8111\u6d1e\u5267\u3002","hidden":"1","cover":"\/\/images.dmzj.com\/webpic\/10\/yiquanwunvfengmianl.jpg","sum_chapters":"1","sum_source":"26","hot_search":"1","hot_hits":"1","first_letter":"y","keywords":"","comic_py":"yiquanwunv","introduction":"\u4ee5\u4e00\u62f3\u8d85\u4eba\u4eba\u8bbe\u66ff\u6362\u4e1c\u65b9\u4e16\u754c\u4eba\u8bbe\u7684\u8111\u6d1e\u5267\u3002","addtime":null,"authors":"ColonelAki\uff08AKI\u5927\u4f50\uff09","types":"\u4e1c\u65b9","series":"\u4e1c\u65b9","need_update":"0","update_notice":"","readergroup":"\u5c11\u5e74\u6f2b\u753b","readergroup_tag_id":"3262","has_comment_id":"1","comment_key":"","day_click_count":"0","week_click_count":"0","month_click_count":"0","page_show_flag":"0","token":"IpMpUp","source":"\u8f6c\u8f7d","grade":"0","copyright":"0","direction":"1","token32":"a7b5462b6ea97e6462c595112fa7fb0d","url":"","mobile":"1","w_link":"2","app_day_click_count":"1","app_week_click_count":"1","app_month_click_count":"1","app_click_count":"1","islong":"2","alading":"2","uid":null,"week_add_num":"0","month_add_num":"0","total_add_num":"0","sogou":"2","baidu_assistant":"0","is_checked":"0","quality":"1","is_show_animation_list":"0","zone_link":"","is_dmzj":"0","device_show":"3","myfcomic_comic_id":"0","comic_name":"\u4e00\u62f3\u5deb\u5973","comic_author":"ColonelAki\uff08AKI\u5927\u4f50\uff09","comic_cover":"\/\/images.dmzj.com\/webpic\/10\/yiquanwunvfengmianl.jpg","comic_url_raw":"\/\/manhua.dmzj.com\/yiquanwunv","comic_url":"\/\/manhua.dmzj.com\/yiquanwunv","chapter_url_raw":"\/\/manhua.dmzj.com\/yiquanwunv","chapter_url":"\/\/manhua.dmzj.com\/yiquanwunv"},{"id":"46269","name":"\u706b\u5f71\u5fcd\u8005\u4e4b\u65b0\u7684\u4f19\u4f34\uff1a\u6b7b\u795e\u548c\u4e00\u62f3\u8d85\u4eba","alias_name":"","real_name":"","publish":null,"type":null,"zone":"\u5185\u5730","zone_tag_id":"2308","language":"\u4e2d\u6587","status":"","status_tag_id":"2309","last_update_chapter_name":"\u6740\u624b\u4e4b\u8def","last_update_chapter_id":"79505","last_updatetime":"1542889296","check":"0","chapters_tbl":"comics_chapter_4","description":"\u6f29\u6da1\u9e23\u4eba\u7a81\u7136\u9020\u8bbf\u5c38\u9b42\u754c\uff0c\u6b63\u4e07\u5206\u7591\u60d1\u4e4b\u95f4\u770b\u89c1\u96cf\u7530\u88ab\u4eba\u63b3\u8d70\uff0c\u5fc3\u6025\u4e4b\u4e0b\u9e23\u4eba\u6012\u95ef\u701e\u7075\u5ef7\uff01\u5230\u5e95\u662f\u8c01\u5728\u5e55\u540e\u64cd\u7eb5\u7740\u4e00\u5207\uff1f\u9e23\u4eba\u53c8\u5c06\u643a\u624b\u54ea\u4e9b\u65b0\u7684\u4f19\u4f34\u5bf9\u6297\u90aa\u6076\uff08\u7426\u7389\u8001\u5e08\uff1f\u9f99\u5377\uff1f\u9ed1\u5d0e\u4e00\u62a4\uff1f\u5c0f\u516b\uff1f\uff09\uff1f\u8ba9\u6211\u4eec\u62ed\u76ee\u4ee5\u5f85\uff01","hidden":"0","cover":"\/\/images.dmzj.com\/img\/webpic\/14\/1077199341540533397.jpg","sum_chapters":"5","sum_source":"34","hot_search":"1","hot_hits":"1","first_letter":"h","keywords":"","comic_py":"huoyingrenzhezhixindehuobansishenheyiquanchaoren","introduction":"\u6f29\u6da1\u9e23\u4eba\u7a81\u7136\u9020\u8bbf\u5c38\u9b42\u754c\uff0c\u6b63\u4e07\u5206\u7591\u60d1\u4e4b\u95f4\u770b\u89c1\u96cf\u7530\u88ab\u4eba\u63b3\u8d70\uff0c\u5fc3\u6025\u4e4b\u4e0b\u9e23\u4eba\u6012\u95ef\u701e\u7075\u5ef7\uff01\u5230\u5e95\u662f\u8c01\u5728\u5e55\u540e\u64cd\u7eb5\u7740\u4e00\u5207\uff1f\u9e23\u4eba\u53c8\u5c06\u643a\u624b\u54ea\u4e9b\u65b0\u7684\u4f19\u4f34\u5bf9\u6297\u90aa\u6076\uff08\u7426\u7389\u8001\u5e08\uff1f\u9f99\u5377\uff1f\u9ed1\u5d0e\u4e00\u62a4\uff1f\u5c0f\u516b\uff1f\uff09\uff1f\u8ba9\u6211\u4eec\u62ed\u76ee\u4ee5\u5f85\uff01","addtime":"1540453697","authors":"\u516b\u96f6\u4e94","types":"\u683c\u6597\/\u70ed\u8840","series":"","need_update":"1","update_notice":"\u4e0d\u5b9a","readergroup":"\u5c11\u5e74\u6f2b\u753b","readergroup_tag_id":"3262","has_comment_id":"0","comment_key":"","day_click_count":"0","week_click_count":"0","month_click_count":"0","page_show_flag":"0","token":"","source":"\u539f\u521b","grade":"0","copyright":"1","direction":"1","token32":"","url":"","mobile":"1","w_link":"2","app_day_click_count":"1","app_week_click_count":"1","app_month_click_count":"1","app_click_count":"1","islong":"1","alading":"2","uid":"107719934","week_add_num":"0","month_add_num":"0","total_add_num":"0","sogou":"2","baidu_assistant":"0","is_checked":"0","quality":"1","is_show_animation_list":"0","zone_link":"","is_dmzj":"0","device_show":"7","myfcomic_comic_id":"0","comic_name":"\u706b\u5f71\u5fcd\u8005\u4e4b\u65b0\u7684\u4f19\u4f34\uff1a\u6b7b\u795e\u548c\u4e00\u62f3\u8d85\u4eba","comic_author":"\u516b\u96f6\u4e94","comic_cover":"\/\/images.dmzj.com\/img\/webpic\/14\/1077199341540533397.jpg","comic_url_raw":"\/\/www.dmzj.com\/info\/huoyingrenzhezhixindehuobansishenheyiquanchaoren.html","comic_url":"\/\/www.dmzj.com\/info\/huoyingrenzhezhixindehuobansishenheyiquanchaoren.html","chapter_url_raw":"\/\/www.dmzj.com\/view\/huoyingrenzhezhixindehuobansishenheyiquanchaoren\/79505.html","chapter_url":"\/\/www.dmzj.com\/view\/huoyingrenzhezhixindehuobansishenheyiquanchaoren\/79505.html"}];'''

js_str = '''
    function fun(){
        %s
        ;
        return g_search_data;
    }
''' % js_str
g_search_data = js2py.eval_js(js_str)
print(g_search_data())
# arr_pages = list(get_arr_pages())
# print(type(arr_pages))
# print(arr_pages)